import request from '@/utils/request'

export const reqGetArtComments = (source, offset) => {
  return request({
    method: 'get',
    url: '/v1_0/comments',
    params: {
      type: 'a',
      source,
      offset
    }
  })
}

export const reqAddComment = (articleId, content) => {
  return request({
    method: 'post',
    url: '/v1_0/comments',
    data: {
      target: articleId,
      content
    }
  })
}

export const reqGetCommentsReplys = (source, offset) => {
  return request({
    method: 'get',
    url: '/v1_0/comments',
    params: {
      type: 'c',
      source,
      offset
    }
  })
}

export const reqAddCommentReply = (commentId, content, articleId) => {
  return request({
    method: 'post',
    url: '/v1_0/comments',
    data: {
      target: commentId,
      content,
      art_id: articleId
    }
  })
}
